package api_model

func CreateMerchantUserInfoFactory(sqlType string) *MerchantUserInfo {
	return &MerchantUserInfo{BaseModel: BaseModel{DB: UseDbConn(sqlType)}}
}

type MerchantUserInfo struct {
	BaseModel
	Id            int32   `gorm:"column:id;primary_key;AUTO_INCREMENT;NOT NULL"`
	Username      string  `gorm:"column:username;NOT NULL;comment:'用户名'"`
	Password      string  `gorm:"column:password;NOT NULL;comment:'密码'"`
	Level         int32   `gorm:"column:level;default:NULL;comment:'等级id'"`
	Contact       string  `gorm:"column:contact;default:NULL;comment:'qq/微信'"`
	Balance       float64 `gorm:"column:balance;default:0.00;NOT NULL;comment:'余额'"`
	FreezeBalance float64 `gorm:"column:freeze_balance;default:0.00;NOT NULL;comment:'冻结金额'"`
	RecommenderId int32   `gorm:"column:recommender_id;default:-1;NOT NULL;comment:'推荐人id'"`
	InviteCode    string  `gorm:"column:invite_code;default:NULL;comment:'邀请码'"`
	State         string  `gorm:"column:state;default:0;NOT NULL;comment:'状态，0未审核，1已经审核'"`
	Remark        string  `gorm:"column:remark;default:NULL;comment:'备注'"`
	LimitLogin    string  `gorm:"column:limit_login;default:0;NOT NULL;comment:'限制登录 0 不限制 1限制'"`
	LimitTask     string  `gorm:"column:limit_task;default:0;NOT NULL;comment:'限制发布 0 不限制 1限制'"`
	LimitWithdraw string  `gorm:"column:limit_withdraw;default:0;NOT NULL;comment:'限制提现 0 不限制 1限制'"`
	LimitInvite   string  `gorm:"column:limit_invite;default:0;NOT NULL;comment:'限制邀请 0 不限制 1限制'"`
	Ip            string  `gorm:"column:ip;default:NULL;comment:'最近登录的ip'"`
	LastLoginTime string  `gorm:"column:last_login_time;default:NULL;comment:'最近登录时间'"`
	CreateTime    string  `gorm:"column:create_time;default:CURRENT_TIMESTAMP;NOT NULL;comment:'创建时间'"`
}

func (u *MerchantUserInfo) TableName() string {
	return "merchant_user_info"
}
